#ifndef __LINKSTACK_H__
#define __LINKSTACK_H__
#include "DoubleLinklist.hpp"
template<typename T>
class LinkStack
{

public:
    LinkStack(){}
    ~LinkStack(){}

    //入栈
    void Push(const T&element)
    {
        list.InsertTail(element);
    }
    //出栈
    void Pop()
    {
        list.RemoveByIndex(list.Size()-1);
    }
    //获取栈顶
    T &GetTop()
    {
        return list.GetTail();

    }
    bool IsEmpty()
    {
        return list.Size()==0;
    }
   
private:
    DoubleLinklist<T> list;

};

#endif